package com.itheima.a05myobjectstream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectStreamDemo2 {
    public static void main(String[] args) throws IOException {
        //熟悉序列化流

        //这里进行序列化
        //创建序列化对象
        ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream("myio\\stu2.txt"));
        //写出
        oos.writeObject(new Student2("zhangsan",19,"男"));
        //关流
        oos.close();
    }
}
